#include <bits/stdc++.h>
using namespace std;
#define int long long
void solve()
{
    string a,b;
    cin>>a>>b;
    int n=a.size();
    int ai=-1,bi=-1;
    for(int i=0;i<n;i++)
    {
        if(a[i]=='#'&&ai==-1)ai=i;
        if(b[i]=='#'&&bi==-1)bi=i;
    }
    if(bi==-1)
    {
        int tmp=0,ans=0;
        while(ai<n)
        {
            if(a[ai++]=='#')
            {
                ans+=tmp;
                tmp=0;
            }
            else tmp++;
        }
        cout<<ans<<endl;
        return ;
    }
    else if(ai==-1)
    {
        int tmp=0,ans=0;
        while(bi<n)
        {
            if(b[bi++]=='#')
            {
                ans+=tmp;
                tmp=0;
            }
            else tmp++;
        }
        cout<<ans<<endl;
        return ;
    }
    else  
    {
        int i=min(ai,bi),ans=0,f,tmp=0;
        if(ai==bi)f=0;
        else if(ai<bi)f=1;
        else f=2;
        while(i<n)
        {
            if(a[i]!='#'&&b[i]!='#')tmp++;
            else if(a[i]=='.'&&b[i]=='#')
            {
                if(f==1)
                {
                    f=0;
                    tmp++;
                    ans+=tmp;
                    tmp=0;
                }
                else 
                {
                    f=2;
                    ans+=tmp;
                    tmp=0;
                }
            }
            else if(a[i]=='#'&&b[i]=='.')
            {
                if(f==2)
                {
                    f=0;
                    ++tmp;
                    ans+=tmp;
                    tmp=0;
                }
                else
                {
                    f=1;
                    ans+=tmp;
                    tmp=0;
                }
            }
            else 
            {
                f=0;
                ans+=tmp;
                tmp=0;
            }
            i++;
        }
        cout<<ans<<endl;
    }
    
}
signed main()
{
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    int T=1;
    //cin>>T;
    while(T--)
    {
       solve();
    }
    return 0;
}